home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 001-025 / scopedisk19 / blinker / scanmodule.sub < prev   
Text File  |  1995-03-18  |  1KB  |  54 lines

  1. '---------------------------------------------------------------------------
  2. '
  3. '                         Scan Module
  4. '
  5. '
  6. '                   Copyright 1987 by Brian Zupke
  7. '
  8. '
  9. '
  10. '      Scans module using Library.Pathname for calls to object
  11. '  modules in the user library (those having the '.sub' extension).
  12. '  Names of modules found are placed in Modules.Called list.  If
  13. '  the module scan fails, then Module.Scanned is returned FALSE.
  14. '  Each line read is also place in destination file to create
  15. '  the executeable program.
  16. '
  17. '
  18.   SUB ScanModule.SUB(ModuleName$,ModulesCalled$(1),Called,ModuleScanned) STATIC
  19.   SHARED LibraryPathname$,Compress
  20. '
  21.   Called = 0
  22.   PRINT "Scanning module ";ModuleName$
  23. '
  24.   OPEN LibraryPathname$+ModuleName$ FOR INPUT AS #1 LEN = 4096
  25. '
  26. '  Scan each line for module call.
  27. '
  28.   IF NoError THEN
  29.     WHILE NoError AND (NOT EOF(1))
  30.       LINE INPUT#1,SourceLine$
  31. '
  32. '  Add line to output file.
  33. '
  34.       CALL CommentCheck.SUB(SourceLine$,LineIsComment)
  35.       IF NOT (LineIsComment AND Compress) THEN
  36.          PRINT #2,SourceLine$
  37.       END IF
  38.       IF NOT LineIsComment THEN
  39.          CALL ScanLine.SUB(SourceLine$,ModuleCall$)
  40.          IF ModuleCall$ <> "" THEN
  41.             Called = Called + 1
  42.             ModulesCalled$(Called) = ModuleCall$
  43.          END IF
  44.       END IF
  45.     WEND
  46.   END IF
  47.   IF NoError THEN
  48.     ModuleScanned = TRUE
  49.   ELSE
  50.     ModuleScanned = FALSE
  51.   END IF
  52.   CLOSE #1
  53.   END SUB
  54.